class ApplicationController < ActionController::Base
  protect_from_forgery

  # app/controllers/application_controller.rb
  def default_url_options(options={})
    logger.debug "default_url_options is passed options: #{options.inspect}\n"
    { :locale => I18n.locale }
  end

  before_filter :set_locale

  def set_locale
    I18n.locale = params[:locale] || I18n.default_locale
  end

  protected

  def confirm_logged_in
    unless session[:user_id]
      logger.warn "Please log in"
      redirect_to(:controller => "access", :action => "login")
      return false #halts the before_filter
    else
      return true
    end
  end

end
